package com.example.controller;

import com.example.pojo.Result;
import com.example.utils.AliyunOssUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
public class UplordController {
    @Autowired
    public AliyunOssUtils aliyunOssUtils;

    @PostMapping("/upload")
    public Result upload(MultipartFile image) throws IOException {
        return Result.success(aliyunOssUtils.upload(image));
    }

}
